package com.campus.schedule.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.campus.common.mybatis.entity.IntegerIdBaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 退款记录表
 * </p>
 *
 * @author ZhaoYuJie
 * @since 2025-07-02
 */
@Getter
@Setter
@TableName("refund_record")
@ApiModel(value = "RefundRecord对象", description = "退款记录表")
public class RefundRecord extends IntegerIdBaseEntity<RefundRecord> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("退款单号，唯一标识")
    @TableField("refund_no")
    private String refundNo;

    @ApiModelProperty("关联订单ID")
    @TableField("order_id")
    private String orderId;

    @ApiModelProperty("退款金额（元）")
    @TableField("refund_amount")
    private BigDecimal refundAmount;

    @ApiModelProperty("退款原因")
    @TableField("refund_reason")
    private String refundReason;

    @ApiModelProperty("退款类型：1-商户拒单，2-用户取消，3-系统退款，4-客服退款")
    @TableField("refund_type")
    private Integer refundType;

    @ApiModelProperty("微信退款单号")
    @TableField("wechat_refund_id")
    private String wechatRefundId;

    @ApiModelProperty("微信支付交易号")
    @TableField("wechat_transaction_id")
    private String wechatTransactionId;

    @ApiModelProperty("退款状态：0-处理中，1-退款成功，2-退款失败")
    @TableField("status")
    private Integer status;

    @ApiModelProperty("退款完成时间")
    @TableField("refund_time")
    private LocalDateTime refundTime;

    @ApiModelProperty("退款失败原因")
    @TableField("failure_reason")
    private String failureReason;

    @ApiModelProperty("操作人ID（系统操作时为空）")
    @TableField("operator_id")
    private Integer operatorId;

    @ApiModelProperty("操作人类型：1-商户，2-用户，3-系统，4-客服")
    @TableField("operator_type")
    private Integer operatorType;

    @ApiModelProperty("备注信息")
    @TableField("remark")
    private String remark;

    @ApiModelProperty("创建时间")
    @TableField("create_time")
    private LocalDateTime createTime;

    @ApiModelProperty("更新时间")
    @TableField("update_time")
    private LocalDateTime updateTime;

    @Override
    public Serializable pkVal() {
        return null;
    }
}
